package com.gin.kotlin.no_gay_alliance.fragment.replyhistory

import com.gin.kotlin.no_gay_alliance.R
import com.gin.kotlin.no_gay_alliance.adapter.replyhistory.ReplyHistoryUserAdapter
import com.gin.kotlin.no_gay_alliance.app.App
import com.gin.kotlin.no_gay_alliance.base.AbstractBindingRecyclerViewAdapter

class ReplyHistoryConfigUserFragment : AbstractReplyHistoryConfigFragment() {
    private lateinit var adapter: ReplyHistoryUserAdapter
    override fun obtainFunctionDescription() = R.string.reply_history_function_info_user

    override fun query() {
        App.INSTANCE.database.replyHistoryUserDao().list()?.also {
            adapter.replaceData(it)
            b?.swipeRefreshLayout?.isRefreshing = false
        }
    }

    override fun showAddDialog() {
        handler?.toastDevInProgress()
    }

    override fun obtainAdapter(): AbstractBindingRecyclerViewAdapter<*, *> {
        this.adapter = ReplyHistoryUserAdapter(requireContext(), handler!!)
        return adapter
    }


}